package kercar.gps;

import java.io.Serializable;

public class GPSPosition implements Serializable {

	/************************************************************************* BLOCK
	 * ATTRIBUTES
	 *******************************************************************************/
	
	private static final long serialVersionUID = 1L;
	
	private double _latitude, _longitude;

	/************************************************************************* BLOCK
	 * CONSTRUCTOR
	 *******************************************************************************/
	
	public GPSPosition(double latitude, double longitude) {
		_latitude = latitude;
		_longitude = longitude;
	}

	/************************************************************************* BLOCK
	 * PUBLIC METHODS
	 *******************************************************************************/

	public void setPosition(GPSPosition position) {
		_latitude = position.getLatitude();
		_longitude = position.getLongitude();
	}
	
	public void setLatitude(double latitude) {
		_latitude = latitude;
	}
	
	public void setLongitude(double longitude) {
		_longitude = longitude;
	}
	
	public double getLatitude() {
		return _latitude;
	}
	
	public double getLongitude() {
		return _longitude;
	}

	public boolean equals(GPSPosition position) {
		return position.getLatitude() == _latitude && position.getLongitude() == _longitude;
	}
	
	public String toString() {
		return "GPSPosition[latitude : " + getLatitude() + " / longitude : " + getLongitude() + "]";
	}
	
}
